package com.jmpt.fangbohui.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.jmpt.fangbohui.bean.BrokerOrderBean;
import com.jmpt.fangbohui.ui.holder.BrokerOrderItemHolder;

public class OrderListAdapter extends BaseAdapter {
	
	private Context mContext;
	public List<BrokerOrderBean> orderList = new ArrayList<BrokerOrderBean>();

    public OrderListAdapter(Context context) {
    	this.mContext = context;
    }
	@Override
	public int getCount() {
		return orderList.size();
	}

	@Override
	public Object getItem(int position) {
		return orderList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		BrokerOrderItemHolder holder = null;
		if (convertView == null) {
			holder = new BrokerOrderItemHolder(mContext);
			convertView = holder.getRootView();
        }else{
        	holder = (BrokerOrderItemHolder) convertView.getTag();
        }
        holder.setData(orderList.get(position));
        
        return convertView;

    }
    
}
